#include <iostream>
#include <string>
#include <list>
#include <algorithm>

using namespace std;

int main()
{
    list<string> strlist;
    string str;
    while(cin >> str)
        strlist.push_back(str);

    cout << count(strlist.begin(), strlist.end(), "zhaojie") << endl;
    return 0;
}
